/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gestor.base.de.datos;

import java.io.Serializable;

/**
 *
 * @author Ana Silvia Gonzáles
 * @author Diego Enríquez
 */
public class Key implements Serializable{
    
    private int tipo;
    private String id;
    private String refDataBase;
    private String refCol;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }
    
    //Tipo 2 es foreign key, 1 es primary key y 0 no es key 
    public Key(String id,int tipo, String refDataBase, String refCol)
    {
        this.tipo=tipo;
        this.id=id;
        
        if(tipo==2)
        {
            this.refCol=refCol;
            this.refDataBase=refDataBase;
        }
        else
        {
            this.refCol="";
            this.refDataBase="";
        }
    }

    public void setTipo(int tipo) {
        this.tipo = tipo;
    }

    public void setRefDataBase(String refDataBase) {
        this.refDataBase = refDataBase;
    }

    public void setRefCol(String refCol) {
        this.refCol = refCol;
    }

    public int getTipo() {
        return tipo;
    }

    public String getRefDataBase() {
        return refDataBase;
    }

    public String getRefCol() {
        return refCol;
    }
    
}
